package com.objecteffects.ilmp.tumblr.method;

import java.util.HashMap;
import java.util.Map;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;

import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * @author Rusty Wright
 */
@JsonInclude(JsonInclude.Include.ALWAYS)
public class Size {
    private final Long width;
    private final Long height;
    private final String url;

    private final Map<String, Object> additionalProperties = new HashMap<>();

    public Size(@JsonProperty("width")
    final Long _width, @JsonProperty("height")
    final Long _height, @JsonProperty("url")
    final String _url) {
        this.width = _width;
        this.height = _height;
        this.url = _url;
    }

    @JsonProperty("width")
    public Long getWidth() {
        return this.width;
    }

    @JsonProperty("height")
    public Long getHeight() {
        return this.height;
    }

    @JsonProperty("url")
    public String getUrl() {
        return this.url;
    }

    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    @JsonAnySetter
    public void setAdditionalProperty(final String name, final Object value) {
        this.additionalProperties.put(name, value);
    }

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public boolean equals(final Object other) {
        return EqualsBuilder.reflectionEquals(this, other);
    }
}
